fix sub de-dup; bunch of tests