fix logic to determine active conditions

@wjwwood Please review.