ubit2pbit flushes at the wrong moment, added one note to bits.h

(e.g. input2[] test sequence from testra/crc_test
 decodes incorrectly to packed bits: 90 b0 3e 80 03 87 53 bd 6f 08,
 this patch fixes it)
diff --git a/src/bits.c b/src/bits.c
index 029cfe5..fcdf5cc 100644
--- a/src/bits.c
+++ b/src/bits.c
@@ -15,7 +15,7 @@
 
 		curbyte |= (in[i] << bitnum);
 
-		if (i > 0 && i % 8 == 0) {
+		if(i % 8 == 7){
 			*outptr++ = curbyte;
 			curbyte = 0;
 		}