FunctionOptimizeCommand should respect closures in vardefs as well