Fixed a bug where saving twice in rapid succession (such as is done by the rename-string functionality) would result in bad JSON.