Script improvments