All of the models were adjusted to handle this case, but it seems like the UI does not save the refcode of an item when it is returned from the search (and thus the database only stores item_id -- bad as these are technically mutable). We need to make sure that the synthesis table prefers refcode over any other identifier.