diff --git a/hashset.c b/hashset.c
index d62e0491..e71764c5 100644
--- a/hashset.c
+++ b/hashset.c
@@ -3,15 +3,13 @@
  *
  * Copyright (C) Tomas Vondra, 2019
  */
+#include "postgres.h"
 
-#include <stdio.h>
 #include <math.h>
-#include <string.h>
 #include <sys/time.h>
 #include <unistd.h>
 #include <limits.h>
 
-#include "postgres.h"
 #include "libpq/pqformat.h"
 #include "nodes/memnodes.h"
 #include "utils/array.h"
@@ -255,10 +253,10 @@ hashset_send(PG_FUNCTION_ARGS)
 	pq_begintypsend(&buf);
 
 	/* Send the non-data fields */
-	pq_sendint(&buf, set->flags, 4);
-	pq_sendint(&buf, set->maxelements, 4);
-	pq_sendint(&buf, set->nelements, 4);
-	pq_sendint(&buf, set->hashfn_id, 4);
+	pq_sendint32(&buf,set->flags);
+	pq_sendint32(&buf,set->maxelements);
+	pq_sendint32(&buf,set->nelements);
+	pq_sendint32(&buf,set->hashfn_id);
 
 	/* Compute and send the size of the data field */
 	data_size = VARSIZE(set) - offsetof(hashset_t, data);
