Properly closing all the database handles now