Moved from process.nextTick to setImmediate.