Bugfix for the endless redirect problem.