Fix bug where first object was not being properly handled