Improved realm support for tokens.