Fixed sign error in the PE calculation