Better handling of redirect errors