Minor fixes for POSIX compatibility