Fix codegen for logical ops bugs.