BUGFIXES and TESTS