Fix some javascript errors
Merge pull request #1209 from najor/hotfix-fix-js-errors

Fix some javascript errors