Fixed the preservation of extra top level keys

The logic was preserving extra keys added manually in the generated file
but was not copying extra keys written in the dist file