Small fix for #1157 by Alex300.
Fixed #1166 by Alex300.
Fixed a small bug in cot_selectbox_structure() with $subcat param used. Cleaned up a few vars.