Implemented database maintenance methods (untested).