Fix some tests
Add an after_db_connect_hook, fix a bug in report