fixes bug in CompositeFilter.

Problem: ClassCastException in some cases

Solution:
Adding an instance of check at the appropriate place.

Notes:
There may remain an issue with the SUBSTRACTION case.
Merge pull request #8 from cc18/compositeFilterTypeFix

CompositeFilter had some problems. Those problems where replicated in 4 ...