Fixed some bugs in parallel version of program (still not effective)