Fixed compatibility with Node.js