Fix hamilton product.