note: amended in c6fd387 to avoid crash in constructor if the connection is not initialized. I did not replicate this but it looks like an obvious problem that could occur given the way the patch was made.