Bug fix. Wrong comparison in If construct