Added error printing for compiling

Cleaned up some code and comments as well