Start putting in some tests for code we're going to have to refactor.
Minor bugfixes/inspection cleanups.