Cleanup and unit test fix.