bugfix + more tests