Updated to fix minor bugs with distance sampling.