Fix login/register problems