Fix potential FPE in selection tests