Improve update performance, see issue #799