Major login and register bugfixes