Fix for latest versions of Moodle.