Revert "Remove some of my custom debugging code that conflicted with upstream changes"

This reverts commit e213c39ee45a97687526d8aa6c50d79bd30f40cc.
Revert target calculation inlining from b8df29aa2de07705757a8e6de4.