Fix free error in lists. Fix cks_split and add support for ignoring empty segments.