--- a/help/Makefile.am
+++ b/help/Makefile.am
@@ -123,9 +123,11 @@
 		$(srcdir)/$(MAKEINDEX) \
 	    $(top_builddir)/help/html/$$lang/gimp-xrefs.xml \
 		> $(top_builddir)/help/html/$$lang/gimp-help.xml ; \
-		sed -i -e 's/<gimp-help>/<gimp-help xmlns:panoplugin="http:\/\/panotools.sourceforge.net\/panoplugin\/help">/g' \
-			   -e 's/help-item id=/help-item panoplugin:id=/g' \
-			   $(top_builddir)/help/html/$$lang/gimp-help.xml; \
+		sed -e 's/<gimp-help>/<gimp-help xmlns:panoplugin="http:\/\/panotools.sourceforge.net\/panoplugin\/help">/g' \
+			-e 's/help-item id=/help-item panoplugin:id=/g' \
+			$(top_builddir)/help/html/$$lang/gimp-help.xml \
+			> $(top_builddir)/help/html/$$lang/gimp-help.xml.tmp ; \
+		mv $(top_builddir)/help/html/$$lang/gimp-help.xml.tmp $(top_builddir)/help/html/$$lang/gimp-help.xml ; \
 	done && \
 	touch index.stamp