Fixed errors in accordance with DatabaseSession being moved.