When multiple YAML metadata blocks are used, and two define the same field, the value defined first takes precedence, according to the manual. This was changed briefly in ba3ee62323. This commit reverts to the original behavior and adds a test case.
ba3ee62323