Build 11. Moved the conditional in optim2 to the front to allow short-circuiting properly.