Substitution not quite right; was substituting in const vars which cannot be lvalues.