Fix deviations from POSIX compatibility