It may or may not fix it; "related" as in "relevant", not "caused by".
I tested tokens and confirmed that they looked right before submitting the second merge request, at least.
I don't know if tokens were broken by something done after when I made the second merge request, though, in which case it doesn't fix it.
In that case, !1316 (merged) fixes this.
But given the 2.2.9 feature-freeze, I'll split the fix for this into its own merge request, so that the Lua function and such won't have to be merged simultaneously. Edit: Done.