Bugfixes for testing environment