Fixed cleanup introduced bug due to operator precidence error - added brackets around shift in all_segments_mask initialisation expression.