Reproduction of https://github.com/joyent/node/issues/1362