Fix heartbeat counter