[Olena-patches] milena r2795: Fix subsampling algorithm