Fix bug: Orphaned courses and units not being recognised.