Fix pointer dereference bug

Needed to check for channel closure on read of files chan.