Fixed jshint warnings
Fixed scoping for nodejs