NEW: Now read and write preferences.
CHANGES: fix conflict.