Fix "i" substitution implementation