Fixed invalid contains check

Fixed incorrect emptiness test.