wip bugfixes, more testcases