Lots of script error fixes and other stuff