Catch invalid proc files

Also some cleanup and linting.

Closes #12289