Bugfixes for update method.