Corrected a bug on password management