Fix SQL reconnect