Fix assertion error in when generating arrays from tuple