A few tweaks to the optimizer to make it work with the changed NQP.