more tests and related improvements