Used write() instead of fputs() to put text into pipes. It's still acting weird and hanging with more than 2 processes.