Code cleanup, final coverage tests