diff --git a/src/tdbusm.c b/src/tdbusm.c
index 5e33411..fb48feb 100644
--- a/src/tdbusm.c
+++ b/src/tdbusm.c
@@ -241,7 +241,7 @@ cm_tdbusm_get_vn(DBusMessage *msg, void *parent, long *n)
 		dbus_message_iter_recurse(&iter, &sub_iter);
 		if (dbus_message_iter_get_arg_type(&sub_iter) == DBUS_TYPE_INT64) {
 			dbus_message_iter_get_basic(&sub_iter, &i64);
-			*n = i64;
+			*n = (long int)i64;
 			return 0;
 		}
 	}
diff --git a/src/util-o.c b/src/util-o.c
index c05872c..7feecb9 100644
--- a/src/util-o.c
+++ b/src/util-o.c
@@ -551,7 +551,7 @@ util_NETSCAPE_SPKI_set_sig_alg(NETSCAPE_SPKI *spki, const X509_ALGOR *sig_alg)
 
 static EVP_PKEY *
 util_EVP_PKEY_dup(EVP_PKEY *pkey,
-		  int (*i2d)(EVP_PKEY *, unsigned char **),
+		  int (*i2d)(const EVP_PKEY *, unsigned char **),
 		  EVP_PKEY *(*d2i)(int, EVP_PKEY **, const unsigned char **, long))
 {
 	EVP_PKEY *k;
