Improved a little on computing length of password.