Fixed login issue. Improved login redirection.