Fix bug in length flag and simplify password generator.