Fixing login bugs