php 5.4 Compatibility Commit

* Fixes several places where variables were used as objects prior to being instantiated.
* Fixes a form validation error on  login page.
* Fixes incorrect opening tag on migrations page.