Got rid of posix_spawn. Turned out it was not necessary.