Making the error messages for bad key/dir permissions more understandable

Fixes #6254