Fixes to bugs in Moodle.