Fix issue related to process.nextTick() recursion