fix coverity scan bug CID 1100712
simplify unifier logic
make sure that min/max is handled correctly in AND and OR groups