Stop the heartbeat as soon as we know
Fixes #1431