Miscellaneous moodle fixes