Fixed the log in bug.
Refactoring. Moved login to a partial form.