Fix some POSIX compliance issues.