finializing synchronization. Fixed testcases and fixed other bugs as
well.