fix notice for empty array
Fix warning for class not existing
Fix notice for courses not being set