Tab search and destory

Two bug fixes in types.cpp -- clear() was not clearing tables after deleting all
elements therein.