Referer and weird redirect fix.