Added support for marking and clearing invalid state
Merge pull request #2 from kingsquare/master

Added support for marking and clearing invalid state