Fixed issues with mutating JSON