Fixed more race/async issues