Fix binary checks involving 'undefined' keyword