adjust directory upload test and fix a couple of jshint issues