Fixed a bug with constant generation. ScriptClasses is also now imported when needed.