Fixed bugs that occurred when a new database was created.
Merge branch 'fix_merge_bugs' into develop