Fixed the logic for reading in database files. The previous logic used the default database directory name which may cause a runtime error if a user defined database name was provided.