Fix handling of null/undefined comparisons