Fixed flag detection must always use bitwise
Added failing test for FILTER_NULL_ON_FAILURE flag
Fixed return value with FILTER_NULL_ON_FAILURE flag