bugfixes and test env