process.cwd() fixes for newer version of node