Tracking daemon code fix and new helper script

see commits