Fixed an issue where some old code where using a lot of CPU when the page is loading.