Make login automatic for development, fix some login bugs