Fixing some race conditions in the start and stop sequence and comms.