use C++11 shrinktofit() instead of swap tricks
remove superflous check
implements #949, wrong duration on first segment