Fix a few places where things tended to crash
0.2.2
Fix attachment of Session instance to Connection instance.