Only submit one flag per thing. fixed #191
Added some flaggin tests