Fix errors on database creation