Fixed issues with NOT/OP_MINUS and Ternary operators