Substitution methods are tested.

Minor bugfixes.