Fixes more TeX log parsing problems.

Some opening files where not detected, causing others to be closed prematurely.