Safe mode bug fix
Merge branch 'master' into MOODLE_26_STABLE