Test tidying and increased coverage

Chasing down some extra test coverage with tests for some edge cases and making some tidy-ups at the same time