Loads of script errors fixed