Multiprocessing IOError fixes

Fixes #1897.