Ah I have had that problem before, too. This is the normal way to do what you're talking about, but it has that bug on some fields. Seems like it doesn't do it to all of them though.
I can't quite remember how I overcame this bug last week though I might have resorted to adding a nonstored field that looks up the ID for me and referencing that in the PDF template. I thought I had found a more elegant solution than that, but that should work in the meantime until we think of that more elegant solution.