What to do with all these assertions here?
I think that raising exceptions would be better.

@asmeurer What do you think?