checked: convert a pile of asserts() into optional runtime checks
TEncSearch: remove unused (and shadowed) variable
cleanup clear()