Fix minor bug on pivot selection