further bugfixing in parsers & clean up formatting.py