Fixed some concurrency issues in comm module.