[dev] Fixed problem if nb_end is too small.