Fixed issue referenced in earlier commit. Unfortunately this means substitutions aren't a monoid.