Fixed some shallow and deeper bugs with page layout