Minor fixes to page functionality and added some tests