Fixed bug where getObjects returns nil instead of an error