Fix syncing of documents that contain objects