Fixed bug in clean table; reworked cleaning.