Removed some bugs in multiprocessing