more tests and assertions
small code cleanups