Fixed incorrect doc updating on save()