diff --git a/modules/other/gail/gailutil.c b/modules/other/gail/gailutil.c
index 413d063..fe25d3a 100644
--- a/modules/other/gail/gailutil.c
+++ b/modules/other/gail/gailutil.c
@@ -292,7 +292,7 @@ gail_util_add_key_event_listener (AtkKeySnoopFunc  listener,
   }
   g_hash_table_insert (key_listener_list, GUINT_TO_POINTER (key++), (gpointer) listener);
   /* XXX: we don't check to see if n_listeners > MAXUINT */
-  return key;
+  return key - 1;
 }
 
 static void
