Fix array detection issue