Fix a bug with null keys when setting a value