Fix for history.pushState in older browsers.