Replaced substExprR with substCoreExpr (it doesn't need to be a Rewrite).
Fixed variable-reuse bug in "abstractR".