Mostly working, trying to investigate if there is still a file descriptor issue.