Fixed a bug in task where status was not set for the main task.
Changed some print_buf into debug
Added some more debug messages