Fixed issues with passwordPeek setting, created a test for it and refactored the code.