Fix bug in user distance check.