Fix tests and coverage