Debug assert

Fixes #23

I made it opt-in. But it is easy enough to make it opt-out if you want to keep backwards compatibility.