Script improvements