Add debugging code for checking invariants
Merge pull request #10 from jeroenk/debug-invariant

Add debugging code for checking invariants