Fix for Ticket #279 string replacement global and include DEM variable