Made checking for %…. in string more intelligent.