Improve " and ' balancing. Fixes ROOT-6791.