Fix feeestimate

-Fix bug where we were checking index value against the wrong vector size. This could cause the wrong value to be returned or to return an out of bounds value.
-Move the clearing of the sorted sample vectors to before the debug logging. The debug logging will now give the right answer