Remove prints and handle dead connections properly.