Bug fix for nest object and array and add test