Some fixes with database and naming