Fixed error in course controlling calculations.