Added ASSERTs to all ChunkDef operations.

This should avoid errors such as #276.