Add asserts in example.cc

Fix assertions fails.