Fix history pages

Fix history pages. This is forked from my `ek-setup-staging` branch so please merge that one first (then the diff will be much smaller here)