Ensure that walks through empty directories finish
Fixed JSLint warnings