a few more bugfixes and systematic comparison with original latex output