Optimizer: Fix new problem introduced when fixing issue #44 in last commit. Now this issue should be resolved.