BF: Fixed bug in first if condition.