Changed allowed_object_types logic.

Fixed the tests.