Optimize automatic slopeclass setting.