Small bugfixes in .js code