Fixed the way redirections are handled.