Fixed variable reference for gain index error.