Updated database methods and unit tests.