Passwords are scrambled sometimes with multiple protected string fields

I am experiencing an issue for only some password entries. It seems if you have multiple extra protected string fields for an entry, kdb4/xml.js will not properly decrypt the field leaving garbled text.

I added a test case which exposes the issue - however I am at a loss on how to go about fixing it.