some corner case improvements of the formatter, more unit tests (including some failing ones)