added tests for utils.to_object