fixed a bug related to keep-alive connections and protocol status variables.