Two passcode related bugs( Bug 817912 and Bug 817909) are resolved.

Two passcode related bugs( Bug 817912 and Bug 817909) are resolved. Please pull the changes and do review.

Regards,