Implemented ugly apply function for Substitutions.