Fix manual gain code.