TST: Fix the optimization tests (imports, mostly).