Fix hapi and nodejs
Merge pull request #1296 from hamiltont/fix-javascript

JavaScript: Fix hapi and nodejs