Fix some function and style bugs

Fixing some bugs.
Fix page.php

Fix errors from previous merge