Fixed small JS errors

as promised :)