-Changed usage of process.nextTick to setImmediate.