tests, bugfixes