Small fixes to the database