Bug fix: Incorrect boolean logic