fix #27 and fix #28 by absolutizing segments in two steps