fixes in pattern formatter