Fixed some small problems with the JS of the editor.