add tests for distinct and derivatives.
fix the distinct and derivative tests.