log in fix

and miscellaneous fixes