Yufan's fix for password bug