Fix some redirect loops and problems Upstream-commit: 35fd96f3f9b46eaf062d8035e1d4d5b1e28c4ebf Component: engine