String formatting fixes in heartbeat.py