Fix thermal calculation bug.