A bunch of new asserts

to catch recent bugs closer to the source.