Incorporating Dan's db changes.
Logging in works.