Catch invalid proc files

Also some cleanup and linting.

Closes #12289
Merge pull request #13307 from cachedout/12289

Catch invalid proc files