Added better handling of root page.