Make validation more resilient for large files