Fix for #230: tuple.segment is invalid for length == 0