Fix: Skip optimization when there is nothing to optimize