Added the possibility of setting flags
Fixed tests for the flag setting part
Merge pull request #15 from ciprianc/master

Added the possibility of setting flags