Fixed a serious error in the password generator, and added a fallback option to use the old function