fixed some issues with keyfile reading
Merge pull request #47 from jahntheman/master

fixed some issues with keyfile reading