But wdf != tf...

If the tf is zero, then the term doesn't exist in the database, so it shouldn't be possible for us to get here.