Turn on strict mode in the javascript and fix some variable declaration bugs.