Added some hopeful fixes for the Database Leak
Fixed up DB error, flag parsing fixed.