fix/issue-write-index-quoting
main
When base or pm_agent are not null, they need to be quoted with escaped quotes ("") in write_index calls. This fixes 'write_index would create malformed JSON' error during init.