fix mode ?47 + added test

was broken after TermWriter introduction