better tests, bugfix based on a test, smaller improvements