Corrected counting solutions in case of "overflow", and enabled customisation.