Use nextTick instead of setTimeout

Andrew - just opening this pull request after seeing the comments in the bug. I'm currently having issues building this repo on a mac, but will update this pull request once I have it properly built. Opening this pull request to get your thoughts.