Final changes (I hope) for db->database