Fix TLS, removed too much in rebase