Fix inverted logic.

Ticket: #6461