Fix baud rate detection

Thanks to Ronan Higgins for the fix