Removed all calloc inside dispatch_apply. There are calloc statements within functions called by dispatch_apply, however, so there might still be problems.