Adding handling of segment ids>0 in generated lems
Adding handling of segment ids>0 in generated lems