Fix ratio computing error.