Stripping out the set_database stuff. It's causing problems, is difficult to test and isn't used very often.