I have not tried your application yet, but I have investigated the isse for some time, and if you use the documents you refer to as te background for generatoing MRZ code ("Specifications for Machine Readable Passports (MRPs)"), then it does not seem to take into account that there can be more than 2 digits a the end of line 2.
Every US passports I have seen lately look something like this in line 2: ".......123456789<23456" and not like "....123456789<<<32"
I have not been able to find any documentation for this?
Have you solved this issue?
/Christian