Removing temp pages and updating layout.