Fix some compilation issues occurring when PAPI is not present.