Some fixes for login, register, edit, logout