Bug fixes in delayed disconnect functionality