some bugfixes
more testcoverage