updated heartbeat protocol to v2; fixed some bugs wrt blocking and whatnot