Fixed module loading logic.