Distance filter bug fix