Fix possible synchronization problems.