Fixes valid_objects method