Fixed one index substitution bug