Validate the type of add_object and add_objects arguments
Add tests
Fix #1