Allow nil distance to shorten queries