Remove extra nesting from dictionary