Added better controls for the startup script

* make sure that database type  is read from config
* make sure that usmak is not garbage