Added logging when an error occurres.
Fixed bug with checking, creating, and deleting table(s).

If the database had not yet been opened, the check, create, and delete
(and related methods) would fail since the database would be `nil`.
Additional checks have been implemented to correct this issue.
Added a `close` database instance to the terminal sample.
Enabled debugging for the terminal sample application when in debug.