Patched wrong operand compares

Todo: cerate new VariableDefinition referencing