Fixes in redirection logic