Less buggy calculation of train position and movement deltas.