Properly updates config file now, though it strips comments (this might not be trivial to fix based on quick googling)