Small code improvement
Bug fix

Wrong logical variable