many updates and bugfixes for tests