Cleaned up some code and Makefile.