add test cases for #45
handled nested array, fixed #45