Major bug fixes in scripts, scripts should now work correctly