Fixed segfault in module loading code.