Fixed PEC calculation bug.