Fixed test failure with amount_ref

Because Amount in amount_ref was unhashable, it made tests fail.

amount_ref isn't supposed to be used in "production", but packaging
problems may cause it to be. When that happens, we prefer it to be fully
functional.