Add login, miscellaneous fixes