JSON reading/writing fixed