Replace null filter by proper flag handling.