Fix bugs + example with libpfm