Fix minor bug in script