Used the moodle_url class rather than ->wwwroot for links
Removed return statement that prevented the rest of the script from executing