fixed failing tests, added bug comments