Fixed firstDistance()