(refs #279)Fix redirect URL generation in authentication.
(refs #279)Fix TestCase.