Fixed compile time increase due to always constructing LocalCostTracker. Now only construct LocalCostTracker when needed.