minor tweaks + unit tests for Flag class