POSIX scripting fixes