Fixed broken if from pull request #1