Enhanced to write a preset.