Fix -D and -U by avoiding substring matches.