Fix #246 changed the way mongo config is created and destroyed