Fixed a bug causing main.c to loop forever.