Fixed mistakes in calc_RT.