Fixed more errors in connection.py