Prevent addition of invalid object types.