BUG: consistency between logical ops & type casts