--- src/register/register-gnome/gnucash-sheet.c~	2008-01-07 20:05:28.000000000 -0500
+++ src/register/register-gnome/gnucash-sheet.c	2008-12-04 16:01:47.000000000 -0500
@@ -2367,7 +2367,8 @@
         sheet->width = 0;
         sheet->height = 0;
 
-        sheet->cursor_styles = g_hash_table_new (g_str_hash, g_str_equal);
+        sheet->cursor_styles = g_hash_table_new_full (g_str_hash, g_str_equal,
+						      g_free, NULL);
 
         sheet->blocks = g_table_new (sizeof (SheetBlock),
                                      gnucash_sheet_block_construct,
@@ -2426,8 +2427,9 @@
         sheet->grid = item;
 
         /* some register data */
-        sheet->dimensions_hash_table = g_hash_table_new (g_int_hash,
-                                                         g_int_equal);
+        sheet->dimensions_hash_table = g_hash_table_new_full (g_int_hash,
+							      g_int_equal,
+							      g_free, NULL);
 
         /* The cursor */
         sheet->cursor = gnucash_cursor_new (sheet_group);
--- src/register/register-gnome/gnucash-style.c~	2008-12-04 14:59:49.000000000 -0500
+++ src/register/register-gnome/gnucash-style.c	2008-12-04 16:01:47.000000000 -0500
@@ -48,6 +48,15 @@
         return &key;
 }
 
+static gpointer
+style_create_key (SheetBlockStyle *style)
+{
+        static gint key;
+
+        key = style->cursor->num_rows;
+
+        return g_memdup(&key, sizeof(key));
+}
 
 static void
 cell_dimensions_construct (gpointer _cd, gpointer user_data)
@@ -103,7 +112,7 @@
         if (!dimensions) {
                 dimensions = style_dimensions_new (style);
                 g_hash_table_insert (sheet->dimensions_hash_table,
-                                     style_get_key (style), dimensions);
+                                     style_create_key (style), dimensions);
         }
 
         dimensions->refcount++;
