Added TSRM support for global variables