Fixed small but critical bug with optimization.