Code style fixes, new page refactor and errors on admin page.
Fixes error throwing in admin page.