Slightly more efficient checking of files.