Attempt to fix redirect loops