add assert, fix typo