Bug fixes to server.py and completed heartbeat example.