encoder bug

Hi,

I stumbled over a bug in the packbits encoder. I fixed it and added the corresponding test case.

Regards Stefan