#2685: Fix exception with symbols with no children (sequence contains no elements), factor out common code in separate methods.