Fix problem sha1 outputs wrong hash.
Fix problem sometimes makes incorrect signature.