Move query statement fixup handling to Connection wrapper
fixing namespaces