More fixes to new TLS implementation.