Fix for key capture

Need to allow keys in password element
Merge pull request #820 from timhobbs/upstream-master

Fix for key capture