FIx a bug that cause pref to work incorrectly
make some flags mac-specific