Fixed heartbeat.
Minor changes.
Polish.