Fixed an issue when a script engine is somehow initialized with wrong parameters.