Put back something I think I blatted away by accident

@opyate sorry one more for you. I seem to have lost the config cleanup, so here it is again.