ofType: Improve the filter with primitive types.