Fixed bugs with synchronizations