Fix bugs in Main.c and modified Makefile.