Fix incorrect check from PR #243

This fixes my last pull request #243