Fix a compiler error by including Flag.h
Fix a compiler warning by changing !foo(...) == 0 to foo(...) != 0
Merge branch 'tickets/DM-1302'