Fix bug in async tests