Added Gunnar's hacks to deal with refscan pfiles