Fixes to follow moodle coding guidelines