bug fixes for tests