Fixed significant bug revolving around incorrect usage of panic.  This
exposed other problems, which too were fixed.  Added Decoder funciton.