Fixes login redirect bug.