Fix issue where returnObject() did not properly retain the passed object.