further test coverage and fixes