Fixed some module loading order issues