Some cleanup and fixes for code coverage.

#398