TSRM fixes

With this patch the last release builds just fine in both TS/NTS, so all the best.