Fix regression in node 10.x - see https://github.com/joyent/node/issues/5003