Fix POSIX implementation