Bug fixes with deleting a database.
Cleaning up a bit.