Fix some issues in the handler dependency tracker.