Fix array allocation in test