improve test code coverage + minor fixes