Limit max value to gain.