Minor database interaction fixes.