small fixes to database