Gain performance improvements (don't waste time applying gain when not necessary).