Fix calculation of negative temperature