Fixed an issue where the password entry history len wasn't being
determined correctly. Also added tests to ensure it doesn't come back.