Fix __do_heartbeat() redundant calls' bug; fix many popen calls' bug.