diff --git a/e2fsck/pass2.c b/e2fsck/pass2.c
index ecc0aaa..3a91e98 100644
--- a/e2fsck/pass2.c
+++ b/e2fsck/pass2.c
@@ -1085,7 +1085,7 @@ inline_read_fail:
 			    ((fs->blocksize - (8 + dx_csum_size)) /
 			     sizeof(struct ext2_dx_entry))))
 			dx_db->type = DX_DIRBLOCK_NODE;
-		is_leaf = 0;
+		is_leaf = (dx_db->type == DX_DIRBLOCK_LEAF);
 	}
 out_htree:
 #endif /* ENABLE_HTREE */
diff --git a/e2fsck/problem.c b/e2fsck/problem.c
index 80c6492..5916d01 100644
--- a/e2fsck/problem.c
+++ b/e2fsck/problem.c
@@ -1597,7 +1597,7 @@ static struct e2fsck_problem problem_table[] = {
 
 	/* leaf node passes checks but fails checksum */
 	{ PR_2_LEAF_NODE_ONLY_CSUM_INVALID,
-	  N_("@d @i %i, %B, offset %N: @d passes checks but fails checksum.\n"),
+	  N_("@d @i %i, %B: @d passes checks but fails checksum.\n"),
 	  PROMPT_FIX, PR_PREEN_OK },
 
 	/* inline directory inode size must be a multiple of 4 */
diff --git a/tests/f_dir_bad_csum/expect.1 b/tests/f_dir_bad_csum/expect.1
index b2b2fae..94e72da 100644
--- a/tests/f_dir_bad_csum/expect.1
+++ b/tests/f_dir_bad_csum/expect.1
@@ -1,6 +1,6 @@
 Pass 1: Checking inodes, blocks, and sizes
 Pass 2: Checking directory structure
-Directory inode 12, block #0, offset 12: directory passes checks but fails checksum.
+Directory inode 12, block #0: directory passes checks but fails checksum.
 Fix? yes
 
 Directory inode 13, block #0, offset 0: directory has no checksum.
diff --git a/tests/f_htree_leaf_csum/expect.1 b/tests/f_htree_leaf_csum/expect.1
new file mode 100644
index 0000000..d6b179e
--- /dev/null
+++ b/tests/f_htree_leaf_csum/expect.1
@@ -0,0 +1,12 @@
+Pass 1: Checking inodes, blocks, and sizes
+Pass 2: Checking directory structure
+Directory inode 12, block #1: directory passes checks but fails checksum.
+Fix? yes
+
+Pass 3: Checking directory connectivity
+Pass 4: Checking reference counts
+Pass 5: Checking group summary information
+
+test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
+test_filesys: 430/512 files (0.2% non-contiguous), 45/512 blocks
+Exit status is 1
diff --git a/tests/f_htree_leaf_csum/expect.2 b/tests/f_htree_leaf_csum/expect.2
new file mode 100644
index 0000000..1609785
--- /dev/null
+++ b/tests/f_htree_leaf_csum/expect.2
@@ -0,0 +1,7 @@
+Pass 1: Checking inodes, blocks, and sizes
+Pass 2: Checking directory structure
+Pass 3: Checking directory connectivity
+Pass 4: Checking reference counts
+Pass 5: Checking group summary information
+test_filesys: 430/512 files (0.2% non-contiguous), 45/512 blocks
+Exit status is 0
diff --git a/tests/f_htree_leaf_csum/image.gz b/tests/f_htree_leaf_csum/image.gz
new file mode 100644
index 0000000000000000000000000000000000000000..f2e461990c095b045750eb6fb657e660a1a360e5
GIT binary patch
diff --git a/tests/f_htree_leaf_csum/name b/tests/f_htree_leaf_csum/name
new file mode 100644
index 0000000..43c6ada
--- /dev/null
+++ b/tests/f_htree_leaf_csum/name
@@ -0,0 +1 @@
+bad csum in htree leaf block
