Fixed some possible ways connections could linger indefinitely without being killed.