diff --git a/sflphone-client-gnome/src/contacts/calltree.c b/sflphone-client-gnome/src/contacts/calltree.c
index 293c59e7c2e4084d8866fdc71166932b407a5932..1157b5f630847a3b016fe992173f0a38f46ace0c 100644
--- a/sflphone-client-gnome/src/contacts/calltree.c
+++ b/sflphone-client-gnome/src/contacts/calltree.c
@@ -1240,7 +1240,7 @@ static void drag_begin_cb(GtkWidget *widget, GdkDragContext *dc, gpointer data)
 
 	GtkTargetList* target_list;
 
-	// g_print("drag_begin_cb %s\n", dragged_path);
+	// DEBUG("drag_begin_cb %s\n", dragged_path);
 	if((target_list = gtk_drag_source_get_target_list(widget)) != NULL);
 
 
@@ -1435,7 +1435,7 @@ static void drag_end_cb(GtkWidget * widget, GdkDragContext * context, gpointer d
 void drag_data_received_cb(GtkWidget *widget, GdkDragContext *context, gint x, gint y, GtkSelectionData *selection_data, guint info, guint t, gpointer data)
 {
 
-	// g_print("drag_data_received_cb\n");
+	// DEBUG("drag_data_received_cb\n");
 	GtkTreeView *tree_view = GTK_TREE_VIEW(widget);
 	GtkTreePath *drop_path;
 	GtkTreeViewDropPosition position;
@@ -1477,7 +1477,7 @@ void drag_data_received_cb(GtkWidget *widget, GdkDragContext *context, gint x, g
 				dragged_call_id = "NULL";
 				dragged_call = NULL;
 				dragged_conf = NULL;
-				g_print("    AFTER dragged_path %s, dragged_call_id %s, dragged_path_depth %i\n", dragged_path, dragged_call_id, dragged_path_depth);
+				// DEBUG("    AFTER dragged_path %s, dragged_call_id %s, dragged_path_depth %i\n", dragged_path, dragged_call_id, dragged_path_depth);
 				break;
 
 			case GTK_TREE_VIEW_DROP_INTO_OR_AFTER:
@@ -1493,7 +1493,7 @@ void drag_data_received_cb(GtkWidget *widget, GdkDragContext *context, gint x, g
 					dragged_call_id = ((conference_obj_t*)g_value_get_pointer(&val))->_confID;
 					dragged_conf = (conference_obj_t*)g_value_get_pointer(&val);
 				}
-				g_print("    INTO_OR_AFTER dragged_path %s, dragged_call_id %s, dragged_path_depth %i\n", dragged_path, dragged_call_id, dragged_path_depth);
+				// DEBUG("    INTO_OR_AFTER dragged_path %s, dragged_call_id %s, dragged_path_depth %i\n", dragged_path, dragged_call_id, dragged_path_depth);
 				break;
 
 			case GTK_TREE_VIEW_DROP_BEFORE:
@@ -1502,7 +1502,7 @@ void drag_data_received_cb(GtkWidget *widget, GdkDragContext *context, gint x, g
 				dragged_call_id = "NULL";
 				dragged_call = NULL;
 				dragged_conf = NULL;
-				g_print("    BEFORE dragged_path %s, dragged_call_id %s, dragged_path_depth %i\n", dragged_path, dragged_call_id, dragged_path_depth);
+				// DEBUG("    BEFORE dragged_path %s, dragged_call_id %s, dragged_path_depth %i\n", dragged_path, dragged_call_id, dragged_path_depth);
 				break;
 
 			case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE:
@@ -1518,7 +1518,7 @@ void drag_data_received_cb(GtkWidget *widget, GdkDragContext *context, gint x, g
 					dragged_call_id = ((conference_obj_t*)g_value_get_pointer(&val))->_confID;
 					dragged_conf = (conference_obj_t*)g_value_get_pointer(&val);
 				}
-				g_print("    INTO_OR_BEFORE dragged_path %s, dragged_call_id %s, dragged_path_depth %i\n", dragged_path, dragged_call_id, dragged_path_depth);
+				// DEBUG("    INTO_OR_BEFORE dragged_path %s, dragged_call_id %s, dragged_path_depth %i\n", dragged_path, dragged_call_id, dragged_path_depth);
 				break;
 
 			default:
diff --git a/sflphone-client-gnome/src/dbus/dbus.c b/sflphone-client-gnome/src/dbus/dbus.c
index 643fd50586107c364adf6a0b6be30d98c9fbdb5b..57fb577203109fec4bba8bdf7e3bb1442e8426cf 100644
--- a/sflphone-client-gnome/src/dbus/dbus.c
+++ b/sflphone-client-gnome/src/dbus/dbus.c
@@ -204,12 +204,12 @@ call_state_cb (DBusGProxy *proxy UNUSED,
 
             if (g_strcasecmp (type, "0") == 0)
             {
-                g_print ("incoming\n");
+                // DEBUG("incoming\n");
                 new_call->_history_state = INCOMING;
             }
             else
             {
-                g_print ("outgoing\n");
+                // DEBUG("outgoing\n");
                 new_call->_history_state = OUTGOING;
             }
 
diff --git a/sflphone-client-gnome/src/uimanager.c b/sflphone-client-gnome/src/uimanager.c
index 48b740f2f20f0e8223913f4e99aef19a4463e1a2..f7542452a0774b858487c54d5c766a2b2456d00f 100644
--- a/sflphone-client-gnome/src/uimanager.c
+++ b/sflphone-client-gnome/src/uimanager.c
@@ -269,7 +269,7 @@ void update_actions()
 static void volume_bar_cb (GtkToggleAction *togglemenuitem, gpointer user_data)
 {
 	gboolean toggled = gtk_toggle_action_get_active (togglemenuitem);
-	g_print ("%i\n", toggled);
+	// DEBUG("%i\n", toggled);
 	main_window_volume_controls(toggled);
 	if (toggled || SHOW_VOLUME)
 		dbus_set_volume_controls(toggled);
diff --git a/sflphone-common/src/audio/ringbuffer.cpp b/sflphone-common/src/audio/ringbuffer.cpp
index 38392b6f26924713671fed0c0cb45e56d5aa9c6f..e0d2c505c1948133e09235860343b271b538f7ef 100644
--- a/sflphone-common/src/audio/ringbuffer.cpp
+++ b/sflphone-common/src/audio/ringbuffer.cpp
@@ -99,7 +99,7 @@ RingBuffer::getLen(CallID call_id)
 
     int length = (mEnd + mBufferSize - mStart) % mBufferSize;
     // _debug("    *RingBuffer::getLen: buffer_id %s, call_id %s, mStart %i, mEnd %i, length %i, buffersie %i\n", buffer_id.c_str(), call_id.c_str(), mStart, mEnd, length, mBufferSize);
-    return (mEnd + mBufferSize - mStart) % mBufferSize;
+    return length;
 
 }
 
diff --git a/sflphone-common/src/plug-in/audiorecorder/audiorecord.cpp b/sflphone-common/src/plug-in/audiorecorder/audiorecord.cpp
index 900c466eff9fc225db793fbfa9537d5ee1bd5d70..dee07b35b5edb96ac231477a014b9a627b4a881d 100644
--- a/sflphone-common/src/plug-in/audiorecorder/audiorecord.cpp
+++ b/sflphone-common/src/plug-in/audiorecorder/audiorecord.cpp
@@ -477,7 +477,7 @@ void AudioRecord::recData (SFLDataFormat* buffer, int nSamples)
 
 
         if (sndFormat_ == INT16) {   // TODO change INT16 to SINT16
-            if (fwrite (buffer, sizeof (SFLDataFormat), nSamples, fp) != nSamples)
+            if (fwrite (buffer, sizeof (SFLDataFormat), nSamples, fp) != (unsigned int)nSamples)
                 _debug ("AudioRecord: Could not record data! \n");
             else {
                 fflush (fp);