parallelization code bug fixes