Fixed bug in canon_hash