                 debug.log -> "calling getFunction for #{val}"
                 rv = @module.getFunction val
 
-                if not rv
+                if not rv?
                         debug.log -> "Symbol '#{val}' not found in current scope"
                         rv = @loadGlobal n
 

                        if @finallyStack.length > 0
                                @currentFunction.returnValueAlloca = @createAlloca @currentFunction, types.EjsValue, "returnValue" unless @currentFunction.returnValueAlloca?
                                ir.createStore rv, @currentFunction.returnValueAlloca
                                ir.createStore (consts.int32 ExitableScope.REASON_RETURN), @currentFunction.cleanup_reason
                                ir.createBr @finallyStack[0]
                        else
                                return_alloca = @createAlloca @currentFunction, types.EjsValue, "return_alloca"

                        
                unescapedName = n.callee.name.slice 1
                intrinsicHandler = @ejs_intrinsics[unescapedName]
                if not intrinsicHandler?
                        throw "Internal error: ctor should not be null"

                intrinsicHandler.call @, n, @opencode_intrinsics[unescapedName], true
