Fixed horrible browser history bug.

With a hack.