Use leftmost outermost reduction and fix a bug in substitution.