fixed support for pgtFn.  Fixes #21.  Fixes #22