Fixed some distance finding stuff.