Fixed config directory preparation code.