Updated for compatibility with new pfq libraries (v3.0)