Fix bug in update (not ignoring null optional fields).
Improve bug fix.