Fixes #1745.
Deprecated asyncio module. Fixed old tests.