Fix  a bug (has_transaction)

Introduced by the last commit.