Fixed refresh bugs with redirects