--- a/notification-tail.c
+++ b/notification-tail.c
@@ -12,7 +12,7 @@
 static GOptionEntry entries[] =
 {
   { "size", 's', 0, G_OPTION_ARG_INT, &tail_size,"The size in bytes of the tail part that is to be read",NULL},
-  { G_OPTION_REMAINING,0,0,G_OPTION_ARG_FILENAME_ARRAY,&files,"File to be watched", "TABLE_FILE" },
+  { G_OPTION_REMAINING,0,0,G_OPTION_ARG_FILENAME_ARRAY,&files,"File to be watched", "TEXT_FILE" },
   { NULL }
 };
 
@@ -23,7 +23,8 @@
   FILE *file;
   GtkWidget *text_view;
   GtkTextBuffer *text_buffer;
-  
+  head=NULL;
+
   file=fopen(file_path,"r");
   buffer = (char *) calloc ((tail_size+1),sizeof (char));
   file = fopen (file_path, "r");
@@ -38,7 +39,10 @@
   text_view = gtk_text_view_new();
   text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view));
   gtk_text_buffer_set_text(text_buffer, buffer,strlen(buffer));
-  free(head);
+  if (head)
+    free(head);
+  else
+    free(buffer);
   
   return text_view;
 }
@@ -71,11 +75,7 @@
       gtk_window_set_title(GTK_WINDOW(window), notification_file_name());
       
       gtk_container_add(GTK_CONTAINER (window), scrolled_window);
-      
-      //g_object_ref_sink(window);
-      //gtk_window_set_decorated(GTK_WINDOW(window),FALSE);
-      
-      //image = gtk_image_new_from_file(notification_file_path());
+
       text_view = text_view_new_from_file(notification_file_path());
       gtk_container_add(GTK_CONTAINER (scrolled_window), text_view);