Fix DEx error loop on no returns

merge fix for #991 into db branch