Fixes #742
Merge pull request #750 from MohammadYounes/segment

Fixes issue #742