Corrections to database creation and reading