Fixed old tests

* Tests now work properly with the database connector
Fix tests

Fixed the previously hacked together tests that were only half working.