Fix crash when resolving calls to other modules' functions