bugfixes, all tests now work