Fiexd some script bugs.