optimizer: Fix typing errors. Compiler is still failing.