Corrected password recovery logic.