Corrected remove behaviour for courses.length == 0