Increases test coverage and removes some dead code.