Fix bug in random password generation