Fix bug with speed calc