Bug fix

There was an error in case the optimal segmentation of the whole data
consisted of exactly one segment.
Optimised calculations for max_block_length = 1