Added detailed error message for block close mismatch