Update SegmentVisitor such that it will not traverse through sub query scopes
Fix typos and update docblocks