Fix course id detection