Misc fixes

Security: don't use val on the content
JS: prevent error if no visual editor is defined.