Fixed test cases, main activity now kills sync if sync is still syncing and mainactivity is no more