Refactorings and minor fixes in language preference handling
Fixing NPE after successful sync
Laying out buttons of sync dialog