Add flag tests, closes #9