Made location calculations all agree with use-block-distance in the
configuration. Also made a few position calculating things more stable.