Fixed subtle UB case when flatten_aux() was called with an empty list.