Code inspection fixes and 100% line coverage for tests