Fix bug where update wasn't taking upsert option correctly.