Fix for json errors on save