Bug Fix: Complex dictionaries now sort nested dicts by key

We were not sorting complex dictionaries correctly.