Bind onhashchange correctly.