fix bug inverting negated expressions