Fixed some bugs...
Added redirect recursion support.