Fixed bug where nested object results in new object for each key