bug fixes in all tests