Fixed distance measurement.
Fixed some stuff.