Improved set/unset flag methods.