added optimization for heartbeat serialization so that keys are not transmitted for a public heartbeat, since they would be zeroed out anyway.