Bugfixes for compiling the source code, and some comments cleanup

Cleaned up a few typos that prevented compiling without errors. Cleaned up some of the code comments for readability.