Fixed some synchronization issues