Fix some redirect bugs.