Fixed database creation bug