Add template expand desync protection.