Fix stack overflow in track resolver