Is this always going to be ok? Or do we need to test for $course->modules[0] != '' or something like that?