Python connection tests + fixes