Fixed some Script Performance Issues