A robust estimator of the small-scale galaxy correlation function