Improve pem file error checking
Merge pull request #67 from glenjarvis/bug/explicitpathrequest_r0

Improve pem file error checking