fix as_logical