Fix type errors in patterns
Autogenerate pretty printing rules for PGF tree printer