dirty_hash_to_rule was modifying it's argument

... causing other bugs to creep in.
Merge pull request #35 from asgeo1/fix_dirty_hash_to_rule

dirty_hash_to_rule was modifying it's argument