Fixed bugs in multiprocessing ability