Fixed bugs in JS and added leading zeos to line numbers