Load DB config from properties file

- Load DB config from file.
- Minor bug fixex