Build fixes for tls