Hashcons fix

On top of #646.