More static build fixes

And a logging adjustment to the TLS code.