Finalized fix for scalars and newObjects.