Several code improvements, login-test fixed
tab to space conversion