Improves test coverage and performance

Coverage now at 86%.