Added *_assert functions: they help to easily verify if a data structure is in a valid state.