Fixing speed calculations