Fixed bugs in `test_connection.py`; simplified it.