Fixed issue with insert tags not being replaced