Fixed some redirect bugs