     }
     
     private func writeRun(name: String, functionType: Parser.FunctionType, to output: inout String) {
-        output.append("private func \(name)Run(_ function: @escaping ([Any]) -> Any) -> \(name) {\n    return { ")
+        output.append("private func \(name)Run(_ function: @escaping ([Any]) -> Any?) -> \(name) {\n    return { ")
         if functionType.returnType == nil {
             output.append("_ = ")
         }

        output.append("""
                        }
                    }
                    let returnValue = value(function.returnStep, in: stack)
                    if let function = returnValue as? Function {
                        return { self.run(function: function, symbols: symbols, stack: stack + [Runtime(arguments: $0)]) }

            }
        }
        output.append("""
                private func run(function: Function, symbols: Symbols, stack: [Runtime]) -> Any? {
                    let runtime = stack.last!
                    for (i, step) in function.steps.enumerated() {
                        switch step.producer! {
