Added check for nonexistent files.