Made serial auto-connection more robust