Fix partests with the optimizer.
Merge pull request #846 from sjrd/fix-partests-with-optimizer

Fix partests with the optimizer.