Added unit tests.
Removed useless filters.
more unit tests.
Fixed bugs in unit tests.
More unit tests.