Smartdict fixes

### Changelog
* Fix serious bug that caused `smartdict`s to share state.
* `getKey`: Default argument is now used.
Could you explain the difference between these two tests? Is the first one an object and the second one a value?