Improved handling of number of (sub-)curves.