Updated for Moodle 2.6