Fixed bug in flagvector |=
Refactoring done while debugging