Added further tests, refactored several existing tests.