fixed failing tests and improved test-coverage significantly