Fixed bug in update_progress algorithm.