Fix substitution of the non-last attributes.