Compat fixes for py26
Fixed remote db connect bug