Thanks for that fix. I found a few glitches, mostly having to do with storing WEOF in a wchar_t, which is not portable. There were also some opportunities for simplification and clarification. I installed the patch, and followed it up with the attached three patches. The second patch is the only one that fixes any bugs.