Adapt tracking-dependents script for AACR, fix up code a little