Fix a small bug in the new update() function.