Fix management commands to use CourseKeys