Fixed undefined variable in 'logic_compare'