Fix a race condition in the speed command