Minor format code
Removing remove_XSS when inserting in the DB
Fixing tpl error when course is not set