MySQL settings overwrite existing advancedsettings.xml

I was able to recreate the overwrite behavior, as described below. One comment first. I initially attempted to recreate the behavior using a test advancedsetting.xml that had clean formatting, without any comments. In that case, when configuring MySQL via MyOSMC addon, the new MySQL settings were properly incorporated. For my test case, below, I used a test xml file that included a number of comments (similar to the file I had that was originally overwritten but don’t have a backup of). I haven’t confirmed if the comments themselves cause the issue but the behavior does occur under the conditions described below.

Started with the following test advancedsettings.xml:

Enabled logging
Restarted mediacenter

Manually edited advancedsettings.xml to include MySQL settings:

Upon restart, MySQL settings were NOT enabled, per MyOSMC addon.

Then, I enabled and configured MySQL via MyOSMC addon.
Upon exit, the MySQL settings did take effect. However, all the previous network settings and comments had been stripped out. The final advancedsettings.xml was as shown here:
http://pastebin.com/Aq1vJKfq

Logs:
http://paste.osmc.io/uzoquzuvot

As an aside, using the addon to configure MySQL I noticed that it is necessary to type “MyVideos” and “MyMusic” over the preset placeholders with the same values. This has been observed before:
[https://discourse.osmc.tv/t/mysql-issue-on-october-update/9401/16?

Also, I noticed that MySQL credentials are stored in clear text in the log.