Fixed the position setting on segment creation
Fixes #6 generation of random number in specified range in segment factory