Improve debugging, fix an assertion bug
Implement keep-alive support for application connections