Fix to replacing tags.