Fix the PHAF exporter and add test