more NPM fixes and tests