Updated unit tests and database stuff