Fixed bug where SerialPort::heartbeat was being executed continually.