Added ref binding.
Changed updateDoc() to update fields with errors if read only.