Null check for ctkXnatSettings in login dialog, refactorings