Fixing a bug in SegmentInstance. It should set the Source/Destination only if hte location returned by the third layer is non-null