Fix package folder flattening

Respect the `keepExpandedHierarchy` option