New version after jslint fixes