Fix getReturnedKeys when creating models.