Fix for consistent NULL checking