Fix SynchronizationContext issue (#633)