Distance bug found and fixed