More coverage tests and redundant code removal.