Fixed some of the repository update/upsert methods.