Fix aberrant popstate behavior