Added more locking in comm.