Fixed issue and coding style:
- Fixed: Theme not applied on the login page if login fails.
- Clened the templates and fixed various not critical code style issues.