Merge pull request #20 from seancarr/master

fix two small bugs in encodeHash