minor bug fixes to log-in/out mechanism