Delete any leftover log instructions in optimize.