Fixes to json update
Fixes to !760 (merged) changes, cherry-picked from !783 (merged).
Keep locked as bool as that's what's in the config dir.
Note that it's specified as an integer in docs/ and also some places in the code, so the expected behaviour should be clarified.