Finished porting changes to Database.