Fixed small script related bugs.