Adjust TS computation code to avoid re-optimization after TS computation.