Small fixes to redirect code.