Fix array length issues.