Bug fixes regarding database creation