fix infinite loop in expandSymString