Fix use of the history API.