Fix redirection bugs

Also remove unneeded stuff