Fix some script bugs caused by renaming