diff -ruN a/Makefile.am b/Makefile.am
--- a/Makefile.am	2017-02-06 16:01:16.484367300 +0100
+++ b/Makefile.am	2017-02-06 16:06:28.013569300 +0100
@@ -8,18 +8,18 @@
 ## FIXME: installing autoconf-generated config.h is just PLAIN WRONG.
 
 install-exec-hook:
-	cp config.h $(DESTDIR)/$(includedir)/giac
-	./mkinstalldirs $(DESTDIR)/$(prefix)/share/
-	./mkinstalldirs $(DESTDIR)/$(prefix)/share/pixmaps
-	cp xcas.xpm $(DESTDIR)/$(prefix)/share/pixmaps/xcas.xpm
-	./mkinstalldirs $(DESTDIR)/$(prefix)/share/applications
-	cp xcas.desktop $(DESTDIR)/$(prefix)/share/applications/xcas.desktop
-	./mkinstalldirs $(DESTDIR)/$(prefix)/share/application-registry
-	cp xcas.applications $(DESTDIR)/$(prefix)/share/application-registry/xcas.applications
-	./mkinstalldirs $(DESTDIR)/$(prefix)/share/icons/
-	./mkinstalldirs $(DESTDIR)/$(prefix)/share/icons/hicolor
-	for SIZE in 256 128 64 32 16; do ./mkinstalldirs $(DESTDIR)/$(prefix)/share/icons/hicolor/$${SIZE}x$${SIZE} && ./mkinstalldirs $(DESTDIR)/$(prefix)/share/icons/hicolor/$${SIZE}x$${SIZE}/apps && cp icons/xcas_$${SIZE}.png $(DESTDIR)/$(prefix)/share/icons/hicolor/$${SIZE}x$${SIZE}/apps/xcas.png; done
-	for SIZE in 256 128 64 32 16; do ./mkinstalldirs $(DESTDIR)/$(prefix)/share/icons/hicolor/$${SIZE}x$${SIZE}/mimetypes && cp icons/x-xcas_$${SIZE}.png $(DESTDIR)/$(prefix)/share/icons/hicolor/$${SIZE}x$${SIZE}/mimetypes/application-x-xcas.png;  done
+	cp config.h $(DESTDIR)$(includedir)/giac
+	./mkinstalldirs $(DESTDIR)$(prefix)/share/
+	./mkinstalldirs $(DESTDIR)$(prefix)/share/pixmaps
+	cp xcas.xpm $(DESTDIR)$(prefix)/share/pixmaps/xcas.xpm
+	./mkinstalldirs $(DESTDIR)$(prefix)/share/applications
+	cp xcas.desktop $(DESTDIR)$(prefix)/share/applications/xcas.desktop
+	./mkinstalldirs $(DESTDIR)$(prefix)/share/application-registry
+	cp xcas.applications $(DESTDIR)$(prefix)/share/application-registry/xcas.applications
+	./mkinstalldirs $(DESTDIR)$(prefix)/share/icons/
+	./mkinstalldirs $(DESTDIR)$(prefix)/share/icons/hicolor
+	for SIZE in 256 128 64 32 16; do ./mkinstalldirs $(DESTDIR)$(prefix)/share/icons/hicolor/$${SIZE}x$${SIZE} && ./mkinstalldirs $(DESTDIR)$(prefix)/share/icons/hicolor/$${SIZE}x$${SIZE}/apps && cp icons/xcas_$${SIZE}.png $(DESTDIR)$(prefix)/share/icons/hicolor/$${SIZE}x$${SIZE}/apps/xcas.png; done
+	for SIZE in 256 128 64 32 16; do ./mkinstalldirs $(DESTDIR)$(prefix)/share/icons/hicolor/$${SIZE}x$${SIZE}/mimetypes && cp icons/x-xcas_$${SIZE}.png $(DESTDIR)$(prefix)/share/icons/hicolor/$${SIZE}x$${SIZE}/mimetypes/application-x-xcas.png;  done
 
 ACLOCAL_AMFLAGS = -I m4
 
diff -ruN a/src/Makefile.am b/src/Makefile.am
--- a/src/Makefile.am	2017-02-06 16:01:51.663379800 +0100
+++ b/src/Makefile.am	2017-02-06 16:01:25.730657700 +0100
@@ -85,8 +85,8 @@
 bin_SCRIPTS = pgiac
 
 install-exec-hook:
-	rm -f $(DESTDIR)$(bindir)/cas_help
-	mv $(DESTDIR)/$(bindir)/aide$(EXEEXT) $(DESTDIR)$(bindir)/cas_help
+	rm -f $(DESTDIR)$(bindir)/cas_help$(EXEEXT)
+	mv $(DESTDIR)$(bindir)/aide$(EXEEXT) $(DESTDIR)$(bindir)/cas_help
 	ln -sf cas_help $(DESTDIR)$(bindir)/en_cas_help
 	ln -sf cas_help $(DESTDIR)$(bindir)/es_cas_help
 	ln -sf cas_help $(DESTDIR)$(bindir)/fr_cas_help
