Tests: Improve test coverage

This pull request improves code coverage by removing dead code and adding tests to features/utility classes that were not sufficiently tested.
I think we have to break this fix out and apply it to `1.3` as well?