Distance corrections and threshold computation.