specializing as_logical on bool + small simplification in scalar all