Added null checks for conditional loads that use 'contains'