Fix bug with heartbeats resetting