more tests & bugfixes