Fixed bug in script.