Use fat arrows (=>) to simplify scope management
Fix connection test failure