aggregation: fix handling of booleans and None/null