diff --git a/asn1specs/p-rec.asn1 b/asn1specs/p-rec.asn1
index bbe700c..2f754fd 100644
--- a/asn1specs/p-rec.asn1
+++ b/asn1specs/p-rec.asn1
@@ -53,4 +53,11 @@ EmployeeNumber ::= [APPLICATION 128] IMPLICIT INTEGER
 
 Date ::= [APPLICATION 3] IMPLICIT IA5String -- YYYYMMDD
 
+-- Suggested simple encoding test
+PDU1 ::= --snacc isPdu:"TRUE" -- SEQUENCE
+{
+    height INTEGER(0..255),
+    width INTEGER(0..255)
+}
+
 END
diff --git a/c-examples/simple/minbuf-ex.c b/c-examples/simple/minbuf-ex.c
index 9b8b334..5b9c769 100644
--- a/c-examples/simple/minbuf-ex.c
+++ b/c-examples/simple/minbuf-ex.c
@@ -65,12 +65,17 @@ main PARAMS ((argc, argv),
     AsnLen decodedLen;
     int     val;
     PersonnelRecord pr;
+    PDU1 p;
     int      size;
     char    *origData;
     struct stat sbuf;
     jmp_buf env;
     int  decodeErr;
     char *filename;
+    char expected_pdu_bytes[] = { 0x30, /* SEQUENCE */
+                                    0x06, /* LENGTH (6-bytes, def) */
+                                      0x02, 0x01, 0x12, /*INT - 18*/
+                                      0x02, 0x01, 0x30  /*INT - 48*/};
 
     if (argc != 2) {
         filename = "pr.ber";
@@ -128,15 +133,37 @@ main PARAMS ((argc, argv),
      */
     encBufSize = size + 512;
     encData = (char*) malloc(encBufSize);
+    memset(encData, 0, encBufSize);
 
     /*
      * set 'buffer' up for writing by setting ptr
      * byte after last byte of the block
      */
+    p.height = 18;
+    p.width = 48;
     GenBufFromMinBuf(&encBuf, encData + encBufSize);
-    (void)BEncPersonnelRecord(&encBuf, &pr);
+    decodedLen = BEncPDU1(&encBuf, &p);
+
+    size = 0;
+    for (int i = encBufSize - decodedLen; i < encBufSize; i++, size++) {
+        if (encData[i] != expected_pdu_bytes[size]) {
+            printf("enc cmp failed - byte: %d [0x%02x vs 0x%02x]\n",
+                   i, encData[i], expected_pdu_bytes[size]);
+            exit(-1);
+        }
+    }
 
     free(encData);
     free(origData);
     return 0;
 }
+
+
+
+
+
+
+
+
+
+
diff --git a/c-lib/src/min-buf.c b/c-lib/src/min-buf.c
index e1d57a8..870cedd 100644
--- a/c-lib/src/min-buf.c
+++ b/c-lib/src/min-buf.c
@@ -60,6 +60,7 @@ MinBufPutSegRvs__(void *b, char *src, unsigned long len)
 {
     unsigned char *dst = (unsigned char *)(*(unsigned char **)b);
     dst -= len;
+    *(unsigned char **)b = dst;
     memcpy(dst, src, len);
 }
 
