Fixed a problem with calculating the progress