Added debug methods. Still acting weird and I'm not sure why. Throws bad file descriptor error with one process, hangs on more than one process.