Fix bug in courses model.