add StyleCop settings
fix style
add missing FlagsAttribute
fix test broken by fc386697