Fixed some TLS issues with large writes.