diff --git a/libxfce4util/filter.c b/libxfce4util/filter.c
index 24e56eb3b9a9121fd3d4c214b181fec47237dcab..784b608585d619daa336e6fe8f751a8774983e48 100644
--- a/libxfce4util/filter.c
+++ b/libxfce4util/filter.c
@@ -28,11 +28,18 @@
 #include <config.h>
 #endif /* !HAVE_CONFIG_H */
 
+#ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
+#endif
 #include <sys/wait.h>
 
 #include <errno.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 
 #include "filter.h"
 
diff --git a/libxfce4util/option.c b/libxfce4util/option.c
index 3128b7dfdb909cb734c83391aac24ec3b06c40e3..c933961780de8b2209e6d2543a3ae9f058ae4a19 100644
--- a/libxfce4util/option.c
+++ b/libxfce4util/option.c
@@ -28,8 +28,12 @@
 #include <config.h>
 #endif /* !HAVE_CONFIG_H */
 
+#ifdef HAVE_STDLIB_H
 #include <stdlib.h>
+#endif
+#ifdef HAVE_STRING_H
 #include <string.h>
+#endif
 
 #include <glib.h>
 
diff --git a/libxfce4util/test.c b/libxfce4util/test.c
deleted file mode 100644
index 9386815f9c53a7b063889d0472e05eb0624ff4cd..0000000000000000000000000000000000000000
--- a/libxfce4util/test.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- */
-
-#include <fcntl.h>
-#include <stdio.h>
-#include <unistd.h>
-
-#include "filter.h"
-
-gchar *args[] = {
-	"cat",
-	NULL
-};
-
-int
-main(int argc, char **argv)
-{
-	XfceFilterList *list;
-	XfceFilter *f;
-	int in, out;
-	int r;
-
-	if (argc != 3) {
-		printf("Usage: in out\n");
-		return(1);
-	}
-
-	if ((in = open(argv[1], O_RDONLY)) < 0)
-		err(1, "open()");
-	
-	if ((out = open(argv[2], O_CREAT | O_TRUNC | O_WRONLY)) < 0)
-		err(1, "open()");
-
-	list = xfce_filterlist_new();
-	f = xfce_filter_new("cat", args);
-	xfce_filterlist_append(list, f);
-
-	if ((r = xfce_filterlist_execute(list, in, out)) <0)
-		perror("xfce_filterlist_execute()");
-	else
-		printf("exit code: %d\n", r);
-}
-
diff --git a/libxfce4util/util.c b/libxfce4util/util.c
index 15ad1f22c2855762f4079e69cec16e4801a4dd84..e2b287ad75373f0f6a3d63a21b17fe057ce6b053 100644
--- a/libxfce4util/util.c
+++ b/libxfce4util/util.c
@@ -33,7 +33,9 @@
 #endif
 #include <errno.h>
 #include <stdio.h>
+#ifdef HAVE_STDLIB_H
 #include <stdlib.h>
+#endif
 
 #include <glib.h>