Improve logical not folding