Fix some issues surrounding WITH_PAPI