Bugfixes in script loading.

New script error reporting system.