fix some character escape issues specific to flex