Fixed non-keep-alive memory leaks but introduced a memory leak in keep-alive connections. Need more investigation.