Cleanup `baseFlatten`.