Fixed bug in creating scripts.