Fixed summary-calculating bug