It looks like
ModuleLoader
is designed to install functions and other data into a script engine, but how are you using it? If possible, please post the code that actually executes script code and raises the exception you're seeing.