Minor changes

Recreating some logic in loging in.