fix a bug in computing average lateness and credit