Fixed heading and dist_traveled calculations.