Bug fixes on config write.