improved asserts

Signed-off-by: Andrzej Krzemienski <akrzemi1@gmail.com>