Fixed bug in scheduler
Added debug option to Makefile