Improve coroutine dispatcher (#933)