pth: ensure mctx flags get set appropriately

Fixes #39.
Fixes #71.