Use the correct max value for distance buffer