Fix legacy IE issue with ampersands

Fixes #796, #3063

Fixes issue as explained in #3063.