Added a heartbeat

Added a heartbeat and some smaller general cleanup actions were also
applied.