Fix errors in assignToCourse()