Fixed a small bug with password generation.

I fixed a small performance bug with the script.