Fixed failed config writing