Fixed bug in update.