Updated to reflect Moodle API change in 2.4
Merge branch 'release-v2.1'