Restructure tasks to avoid deadlock
Merge pull request #1 from brson/master

Restructure tasks to avoid deadlock