Fix config dir and lots of cleanup