Better checking for key dirs
Merge pull request #307 from techhat/issue298

Better checking for key dirs