Fix race in merging
Merge pull request #1063 from twitter/fixWithOnComplete

Fix race in merging