diff --git a/coreapi/Makefile.am b/coreapi/Makefile.am
index 301c059767ed404b407328cdefcead48a6dca6fb..20ab34878fd118dbd7deda536a340932d5de0cf9 100644
--- a/coreapi/Makefile.am
+++ b/coreapi/Makefile.am
@@ -9,9 +9,7 @@ linphone_includedir=$(includedir)/linphone
 linphone_include_HEADERS=linphonecore.h linphonefriend.h linphonecore_utils.h ../config.h lpconfig.h sipsetup.h
 
 INCLUDES = \
-	-I$(top_srcdir)\
-	$(MEDIASTREAMER_CFLAGS)\
-	$(TUNNEL_CFLAGS)
+	-I$(top_srcdir)
 
 
 lib_LTLIBRARIES=liblinphone.la
@@ -42,7 +40,7 @@ liblinphone_la_SOURCES=\
 	linphone_tunnel_manager.h
 
 if BUILD_TUNNEL
-liblinphone_la_SOURCES+=TunnelManager.cc TunnelManager.hh linphone_tunnel_manager.c
+liblinphone_la_SOURCES+=TunnelManager.cc TunnelManager.hh linphone_tunnel_manager.cc
 endif
 
 
@@ -83,3 +81,4 @@ AM_CFLAGS=$(STRICT_OPTIONS)  -DIN_LINPHONE \
 	$(VIDEO_CFLAGS) \
 	$(TUNNEL_CFLAGS)
 
+AM_CXXFLAGS=$(AM_CFLAGS)
diff --git a/coreapi/TunnelManager.cc b/coreapi/TunnelManager.cc
index f1fa17bf7fbd2e2d10e923791294f581b3106556..186575c473f55a88d79546189f9392efdbffd13e 100644
--- a/coreapi/TunnelManager.cc
+++ b/coreapi/TunnelManager.cc
@@ -69,7 +69,6 @@ int TunnelManager::eXosipSelect(int max_fds, fd_set *s1, fd_set *s2, fd_set *s3,
 	if (tv!=0 && tv->tv_sec){
 		/*this is the select from udp.c, the one that is interesting to us*/
 		unsigned int i;
-		fd_set tmp;
 		int udp_fd=eXosip_get_udp_socket();
 		int controlfd=-1;
 
@@ -222,9 +221,9 @@ int TunnelManager::customRecvfrom(struct _RtpTransport *t, mblk_t *msg, int flag
 
 TunnelManager::TunnelManager(LinphoneCore* lc) :TunnelClientController()
 ,mCore(lc)
-,mEnabled(false)
 ,mSipSocket(NULL)
 ,mCallback(NULL)
+,mEnabled(false)
 ,mTunnelClient(NULL)
 ,mAutoDetectStarted(false) {