Clean up comments and some bugs.