Bug fix for IS NOT NULL queries