Move variable declaration up in case of errors during connection step, enable connection buffering, and explicitly set collation flag (no change in behavior)