PatternLayout: various fixes to make it work