Don't update metadata maps with nested nulls.

- Add more tests and assertions