Fixing auto config writing and config writing