Did some testing and fixed small bug in Substitution.