Fixed setup for dbs when not connected

Also, added a lot more test coverage for all of the different events.
refactored one test that wasn't checking a value that would guarantee
correctness.