CocoaWrapper: fix attempt to mutate an immutable dictionary