Fix bug related to heartbeat.