Better NestedDict implementation.