Improvements to script.