Fixed some bugs that snuck in during refactoring, reduced overall volume, commented some code.