Handle nested arrays correclty