Fix a bug where JSON was lost when saving invalid options
Merge branch 'master' into deploy